package com.example.demo.controller;


import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RequestMapping("/test")
@RestController
public class TestController {           //统一异常处理
    @RequestMapping("/t1")
    public Integer t1(){
        int a=10/0;
        return 1;
    }

    @RequestMapping("/t2")
    public Integer t2(){
        int[]a={1,2,3};
        return a[4];
    }

    @RequestMapping("/t3")
    public String t3(){
        return "1";
    }
}
